package com.szzg10.thinking.chapter11;

import java.util.ArrayList;
import java.util.List;

public class GenericsAndUpcasting {

	public static void main(String[] args) {
		List<Apple> list = new ArrayList<Apple>();
		list.add(new Apple());
		list.add(new GrannySmith());
		list.add(new Gala());
		list.add(new Fuji());
		list.add(new Braeburn());
		
		for(Apple element: list) {
			System.out.println(element);
		}
	}
	
}

class GrannySmith extends Apple {}

class Gala extends Apple {}

class Fuji extends Apple {}

class Braeburn extends Apple {}
